package com.edais.dao;

import com.edais.domain.*;
import com.edais.persistence.CenterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository

public class CenterDao {
	@Autowired
	private CenterMapper centerMapper;

	public void modifyUserInfoCd(Date birth, String gender, String IdCard,
			String RealName, int id) throws Exception {
		this.centerMapper.modifyUserInfoCd(birth, gender, IdCard, RealName, id);
	}

	public Finance getFinanceDetail(String id,String enableBuy) throws Exception {
		return this.centerMapper.getFinanceDetail(id,enableBuy);
	}

	public List<UserRecePayCard> getRecePayBank(Map<String,Object> map) throws Exception {
		return this.centerMapper.getRecePayBank(map);
	}

	public ThirdProductRoute getRouteBankByCode(Map<String,Object> map) throws Exception {
		return this.centerMapper.getRouteBankByCode(map);
	}

	public void createRechargeOrder(OrderFormRecharge orderFormRecharge) throws Exception {
		this.centerMapper.createRechargeOrder(orderFormRecharge);
	}
	
	public String getReadyLoanTotalNum(String loanStatus, String loanType) throws Exception {
		return this.centerMapper.getReadyLoanTotalNum(loanStatus, loanType);

	}
	
	public List<Loan> getReadyLoan(String loanStatus, String loanType,String rowBegin, String rowEnd) throws Exception {
		return this.centerMapper.getReadyLoan(loanStatus, loanType, rowBegin, rowEnd);
	}
	
	public int getSeqCycleOrderNo() throws Exception{
		return this.centerMapper.getSeqCycleOrderNo();
	}
	
	public OrderFormRecharge selectOrderFromRechargeByOrderId(String orderId) throws Exception{
		return this.centerMapper.selectOrderFromRechargeByOrderId(orderId);
	}
	
	public int updateOrderFromRecharge(OrderFormRecharge orderFormRecharge) throws Exception{
		return this.centerMapper.updateOrderFromRecharge(orderFormRecharge);
	}
	
	public String[] getCycleMatchType(String planId) throws Exception{
		return this.centerMapper.getCycleMatchType(planId);
	}
	public List<Map<String, String>> getInviteCodeMsg(String userID) throws Exception{
		return this.centerMapper.getInviteCodeMsg(userID);
	}
	
	/**
	 * 查询该债权的具体信息
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Map<String,Object> checkLoanStatus(Map<String,Object> map) throws Exception{
		return centerMapper.checkLoanStatus(map);
	}
	
	public OrderFormRecharge getUserNewestOrderForm(Map<String,Object> map){
		return centerMapper.getUserNewestOrderForm(map);
	}
	
	public int getCountLoan(String financeID) {
		// TODO Auto-generated method stub
		return  this.centerMapper.getCountLoan(financeID);
	}

	public Map<String, Object> getDepositGetDetail(String financeID) {
		// TODO Auto-generated method stub
		return this.centerMapper.getDepositGetDetail(financeID);
	}
	
	/**
	 * 更新订单核心状态
	 * @param orderFormRecharge
	 */
	public int updateOrderFromRechargeCoreStatus(OrderFormRecharge orderFormRecharge){
	   return this.centerMapper.updateOrderFromRechargeCoreStatus(orderFormRecharge);
	}

	public Map<String, Object> getAgrnoAndAssno(Integer bidId) {
		// TODO Auto-generated method stub
		 return this.centerMapper.getAgrnoAndAssno(bidId);
	}
	/**
	 * 查询充值备注根据充值订单的id
	 * @author rxc
	 * @param applyId
	 * @return
	 */
	public String getRemarkByapplyId(Integer applyId){
		return this.centerMapper.getRemarkByapplyId(applyId);
	}
}
